package com.hundsun.s3.platform.backstage.action.report;

import com.hundsun.s3.common.dto.DepartmentDTO;
import com.hundsun.s3.common.dto.SimpleMsg;
import com.hundsun.s3.platform.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.logging.Logger;

/**
 * com.hundsun.s3.platform.backstage.action.report
 *
 * @Description:
 * @Author: yangjun23614
 * @Date: Created in 14:24 2018/3/8
 * V1.0 14:24 2018/3/8
 */
@Controller
@RequestMapping("/back/common")
public class CommonAction {
    @Autowired
    private CommonService commonService;
    static Logger logger = Logger.getLogger(CommonService.class.getName());

    /**
     * @Description: 获取全部部门属性结构
     * @param: 
     * @return:  
     * @Author: yangjun23614
     * @Date: 14:33 2018/3/8
     * V1.0 
     */
    @RequestMapping(value = "/getDeptList.json")
    public @ResponseBody List<DepartmentDTO> getAllDeptList(){
        return this.commonService.getAllDeptList();
    }

    /**
     * @Description:  根据id获取相应的
     * @param:
     * @return:
     * @Author: yangjun23614
     * @Date: 14:21 2018/3/13
     * V1.0
     */
    @RequestMapping(value = "/merge.json")
    public @ResponseBody String mergeDept(@RequestParam(value = "deptNo")  int deptNo){
        return commonService.mergeDept(deptNo);
    }

    /**
     * @Description: 获取聊天记录
     * @param: 
     * @return:
     * @Author: yangjun23614
     * @Date: 11:15 2018/3/14
     * V1.0 
     */
    @RequestMapping(value = "/getChatRecordByIdTime.json")
    public @ResponseBody List<SimpleMsg> getChatRecord(String staffId , String clientName, Long serverStartTime, Long serverEndTime){
        return commonService.getChatRecordByIdTime(staffId,clientName,serverStartTime,serverEndTime);
    }

}
